package com.yingxue.demo.shiro;

import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * @Package: com.company.demo.shiro
 * @Author: Mr.Waves
 * @Date: 2020-03-06 11:18
 * @Description: 自定义token
 **/
public class CustomUsernamePasswordToken extends UsernamePasswordToken {
    private String token;

    public CustomUsernamePasswordToken(String token) {
        this.token = token;
    }

    /*
     * principal: 身份
     */
    @Override
    public Object getPrincipal() {
        return token;
    }

    /*
     * credential: 凭证
     */
    @Override
    public Object getCredentials() {
        return token;
    }
}
